<template>
	<div id="" style="width: 100%;"> <!-- 需要设置一个宽度100% -->
		<div id="menu">
				<van-cell
				:border="false"
				class="caidan" 
				:value="logininfo.isOk? logininfo.user.uName : '未登录'"
				style="text-align: center;" />
				<div v-if="logininfo.isOk">
					<van-cell/>
					<van-cell to="/admin" :icon="require('../assets/zhuanhuan.png')" value="切换管理端" clickable 
					 v-if="logininfo.user.uType == '1'"/>
					
					<van-cell :icon="require('../assets/game.png')" value="我の比赛" clickable to="/myCptt" />
					<van-cell :icon="require('../assets/jiashichengjiu.png')" value="我の成就" clickable to="/" />
					<van-cell :icon="require('../assets/lianxiren.png')" value="联系队长" clickable url="mqqwpa://im/chat?chat_type=wpa&uin=522395628&version=1" />
					<van-cell :icon="require('../assets/coffee.png')" value="更多功能研发中..." clickable  />
					<van-cell
					:icon="require('../assets/goout.png')"
					value="退出登陆"
					@click="logOut"
					clickable />
				
				</div>
				<div v-else>
					<van-cell
					value="去登录"
					to="/login" 
					:icon="require('../assets/tologin.png')"/>
				</div>
				<van-cell :icon="require('../assets/fanhui.png')" value="返回主页" clickable to="/home" />
			</div>
	</div>
	
</template>

<script>
	export default {
	  name: 'ke-menu',
	  data() {
	    return {
			}
		},
	  methods:{
		  logOut(){
		  	this.$store.commit('logOut')
			this.$router.push('/login')
		  }
	  },
	  computed:{
		  logininfo(){
		  		  return this.$store.state.login
		  }
	  }
	}
</script>

<style lang="scss">
	#menu{
		position: fixed;
		top: 0%;
		left: 99.99%;
		// left:100%
		// transform: translate(100%,0);
		width: 42%;
		height: 100%;
		background: #ffffff;
		zoom: 1.3;
		.caidan{
			div{
				text-align: center;
				span{
					font-weight: 700;
					zoom: 1.5;
				}
			}
		}
	}
</style>
